package com.queming.music.entity;

import com.queming.core.entity.File;
import com.queming.core.entity.TraceableBaseEntity;
import com.queming.music.enums.AlbumStatus;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * @author chencidiao
 * @date 2022/05/11 21:34
 **/
@Data
@Entity
public class Album extends TraceableBaseEntity {
    private String name;
    private String description;

    private AlbumStatus status;

    @OneToOne
    private File cover;

    @ManyToMany
    @JoinTable(name = "album_artist",joinColumns =@JoinColumn(name = "album_id",referencedColumnName = "id"),inverseJoinColumns = @JoinColumn(name = "artist_id",referencedColumnName ="id" ))
    private List<Artist> artists;

    @ManyToMany
    @JoinTable(name = "album_music",joinColumns =@JoinColumn(name = "album_id",referencedColumnName = "id"),inverseJoinColumns = @JoinColumn(name = "music_id",referencedColumnName ="id" ))
    private List<Music> musicList;


    private Boolean recommended=false;

    private Integer recommendedFactor=0;

}
